<!DOCTYPE html>
<html lang="en">
{include file="public/head" /}
<link href="__ADMIN__/vendors/jquery-ui/jquery-ui.min.css" rel="stylesheet">
  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <!-- menu -->
        {include file="public/menu" /}
        <!-- menu -->
        <!-- top navigation -->
        {include file="public/top" /}
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>订单管理</h3>
              </div>
            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <!--content-->
                <div class="x_panel">
                  <div class="x_title">
                    <h2>添加订单 <small>add order</small></h2>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br>
                    <form data-parsley-validate="" class="form-horizontal form-label-left" novalidate="" enctype="multipart/form-data" method="post" action="{:url('admin/Order/add')}">

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">客户姓名 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" name="user_contact" required="required" class="form-control user_contact col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">预算 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="number" name="money" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">定金 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="number" name="deposit" required="required" class="form-control col-md-7 col-xs-12">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">产品名称 <span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input name="jewel_name" class="form-control col-md-7 col-xs-12" type="text">
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">客户留言</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <textarea name="user_message" class="form-control col-md-7 col-xs-12"></textarea>
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">订单备注</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <textarea name="order_remark" class="form-control col-md-7 col-xs-12"></textarea>
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">上传图片</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <div class="col-md-6 col-sm-6 col-xs-12">
                            <input type="file" name="pic" accept="image/*" onchange="preview();" id="pic">
                          </div>
                          <div class="col-md-3 col-sm-3 col-xs-12">
                              <img src="" id="show" width="150px">
                          </div>
                        </div>
                      </div>
                      
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button type="submit" class="btn btn-success">创建订单</button>
                          <button class="btn btn-primary" type="reset">重置</button>
                        </div>
                      </div>

                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
        <!-- footer content -->
        {include file="public/footer" /}
        <!-- /footer content -->
      </div>
    </div>
    <!-- script -->
    <!-- jQuery -->
    <script src="__ADMIN__/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="__ADMIN__/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="__ADMIN__/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="__ADMIN__/vendors/nprogress/nprogress.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="__ADMIN__/build/js/custom.min.js"></script>
    <!-- script -->
    <script src="__ADMIN__/vendors/jquery-ui/jquery-ui.min.js"></script>
    <script src="__ADMIN__/build/js/app.js"></script>
  </body>
  <script type="text/javascript">
    var customer_name_url = "{:url('admin/Order/getCustomerName')}";

    var nameSource = Array();
    
    $(function(){
        var name = $(".user_contact");
        
        name.bind('input propertychange', function() {  
            if(name.val() != '')
                getCustomerName(name.val());
        });

        name.autocomplete({
            source:nameSource
        });
    
    });

  </script>
</html>
